Skip to content

Conversation

anim001k
Copy link

@anim001k anim001k commented Oct 3, 2025

Summary

Replace time.Tick with time.NewTicker in the OpenTSDB exporter to enable explicit stop and prevent leaked timers.

Rationale

time.Tick cannot be stopped and may leak timers/goroutines over time. time.NewTicker allows proper lifecycle management and graceful shutdown.

Changes

  • metrics/opentsdb.go: use time.NewTicker(c.FlushInterval) with defer ticker.Stop().

Impact

  • Improves resource management and shutdown behavior.

@jwasinger
Copy link
Contributor

The function never exits, so I don't see how this improves anything.

@jwasinger jwasinger closed this Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants